home *** CD-ROM | disk | FTP | other *** search
/ Programming Sound Cards / Programming Sound Cards.iso / sound_53 / sbrecog.doc < prev    next >
Text File  |  1995-01-01  |  8KB  |  155 lines

  1.  A few notes on the SBRECOG speech recognition demo
  2.  
  3.  
  4.          With SBRECOG, I am presenting a speaker dependent
  5.          speech recognizer that works on DOS machines with
  6.          soundblaster compatible sound cards.  The recognition
  7.          can be quite good if the conditions are optimal:
  8.          -- sufficiently distinct test sets that consist of
  9.             words of two or more syllables
  10.          -- good recording conditions
  11.          Sets that work fine with me are 4-6 element sets
  12.          consisting of Italian numbers or the aviation alphabet.
  13.  
  14.  
  15. The program is based on the paper "Untersuchungen zur Verteilung von
  16. Nulldurchgangsabstaenden in Sprachsignalen" (a study on the distribution
  17. of zero crossing distances in speech signals) by Michael Kirstein, published
  18. in IKP-Forschungsberichte II/62, Hamburg 1977.
  19.  
  20. Under the next two headings, I try to summarize the paper, only of course
  21. as far as I have understood it and think it relevant for the program.
  22.  
  23.  
  24. I. Related works
  25.  
  26. A couple of works presented since the 1950s give reason to assume that
  27. zero crossings of a speech signal contain sufficient information to
  28. allow the discrimination of phonemes or at least words:
  29.  
  30. -- Licklider & Pollack (1948) show that clipped speech remains under-
  31.    standable. In SBRECOG the amplitudes of the individual samples are
  32.    clipped at the value of |1|, i.e. the signal is reduced to 1 Bit
  33. -- Chang, Pihl & Essigmann (1951) examine how the densities of zero
  34.    crossings and extrema (rho0 and rho0') are related to the first and
  35.    second formant in voiced sounds
  36. -- Peterson (1951) shows that their values in the spectrum of vowels are
  37.    proportional to rho0, rho0'.
  38. -- Chang, Pihl & Wiren (1952) introduce the "intervalgram", a graphical
  39.    representation of intervals between zero crossings
  40. -- Kirstein (1971) talks about "Kumulanten" ("cumulants"), characteristic
  41.    concentrations of intervals (horizontal lines in the intervalgram)
  42.  
  43. Kirstein also quotes the rather pessimistic Burghard & Hess (1971) who
  44. come to the result that zero crossing interval distributions did not
  45. allow discrimination of vowels.
  46.  
  47.  
  48. II. Problem and method
  49.  
  50. Windows with common sizes such as 10 or 20 ms are too narrow to give a
  51. stable "view" on a speech signal; the distributions found are not
  52. significant. That is why whole word utterances are chosen as the subject
  53. of study.
  54.  
  55. -- The signal s(t) is clipped to a square signal _s_(t)=c*sgn(s(t))
  56. -- the zero crossing intervals are collected
  57. -- their distribution is examined, i.e. it is counted how many intervals
  58.    have the size i, how many the size i*2 and so on
  59.  
  60. Kirstein makes his PDP 15 micro examine the signal in real time; to reduce
  61. the necessary computations he watches the positive part of the signal only.
  62. Thus he reaches a sample frequency of 32 kHz. He admits that the speech
  63. signal is "not at all symmetrical to the zero line", but thinks the
  64. results are usable anyway.
  65.  
  66. The smallest interval that can be measured (at the resulting time resolution)
  67. is 31.6 mu-s; the biggest that gets counted is 6.3 ms. Thus there are
  68. 200 possible intervals, stretching over a frequency range of 79..15,823 Hz.
  69. These 200 intervals are classified into 16 classes; the idea is that
  70. one class stretches over the bandwidth of about one formant.
  71.  
  72. Here is how Kirstein assigned intervals to the 16 classes:
  73. class   1 2 3 4 5 6 7 8 9    10    11    12    13    14    15    16
  74. interv  1 2 3 4 5 6 7 8 9-10 11-12 13-15 16-19 20-25 26-38 39-78 79-200
  75. mu-s    31      158     284  347   410   505   632   821   1232  2496
  76.  
  77. The signal durations turned out to be varying significantly between speakers
  78. and even between different productions of one speaker. As the zero crossings
  79. vary of course with the length of a signal, relative frequencies must be
  80. calculated.
  81.  
  82. What we have at this point is a 16-dimensional vector representing each
  83. word. Kirstein examines a number of statistical methods that compare
  84. the similarity of two vectors. The one yielding the best results in his
  85. study is a contingency matrix. The method is similar to that employed
  86. by information theorists to calculate the "information transmission rate"
  87. or "Transinformation" (Meyer-Eppler, 1969).
  88.  
  89. The formula combines input entropy + output entropy - overall entropy
  90. to calculate a measure for the transmitted information
  91.         T = Sum_i=1..r ( Sum_j=1..c (p_ij * log_2 (p_ij/(p_i.*p_.j))),
  92. where c, r are columns, rows of the matrix (c: dimension of the vectors,
  93. r: number of vectors to be compared); p_ij are matrix cells, p_i. are
  94. row sums, p_.j column sums.
  95.  
  96. Kirstein decides to smooth out the vectors (by averaging each element
  97. with its weighted nearest neighbours). This turned out be desastrous
  98. in my implementation, so I left out the smoothing.
  99.  
  100.  
  101. III. About my implementation
  102.  
  103. My main interest was voice recognition in the telephone network, thus
  104. I had to make do with a smaller bandwidth and a sampling rate of around
  105. 11 kHz. It is easy to see why the number of possible interval sizes is
  106. reduced to 64 instead of Kirstein's 200 (see the related comments in
  107. the code). Although their classification, that must eventually yield to
  108. the 16-dimensional vector, is quite crucial for the performance of this
  109. method, I must admit I did it quite ad hoc: I printed out a couple of
  110. matrices and decided that they looked characteristical enough...
  111.  
  112. The performance of my program of course changes considerably with
  113. different CPU speeds, as the sampling frequency is not constant on
  114. different machines. If you do not achieve satisfactory results, try
  115. changing the #define value of CPUSPEED to the tact rate of your machine,
  116. or lower. I didn't test the program on machines other that 286s,
  117. so given the quite different CPU designs it may be possible that you
  118. have to set CPUSPEED to a value that doesn't match that of your computer
  119. at all... The playback rate (that you observe during the training of
  120. words) is no clue here, as of course the recognition depends only on
  121. the recording speed. Just fiddle around with these things a bit.
  122.  
  123. The "user interface" of the program is so primitive that you will master
  124. it without my explaining it here. Just note that there are basically
  125. two ways of improving the recognition of a test set:
  126. You can have multiple dictionary entries for different realisations of
  127. one word. You may want to attach different ID strings to the dictionary
  128. entries (like "bravo_1", "bravo_2", "bravo_fast", "bravo_slow"...), so
  129. that you can see how often each of the entries is picked by the program.--
  130. Or you can have the parameter vectors in the dictionary calculated as
  131. the average of two or more (the program supports two only) realisations.
  132. This is what the program means by asking "Would you like another test set
  133. to be averaged with the set entered".
  134.  
  135. The sound blaster interface "direct.obj" was written by Joel Lucsy of
  136. Vroom Diggy Diggy Software and is part of a Freeware package, "Blast".
  137. I am including only the Blast files necessary to compile my demo. If
  138. you want to use the package for your own programs I suggest you let archie
  139. search your favourite ftp servers for it.
  140.  
  141. Why am I publishing this demo program? I would like to see people
  142. starting further experiments inspired by the ideas presented here.
  143. The material is free to use and share. I hope you may feel somewhat
  144. obliged to make your enhancements and applications free software, too.
  145.  
  146. If you have any further questions or comments, you can contact me
  147. by electronic mail at
  148.         kiehl@ldv01.uni-trier.de
  149. or by conventional mail
  150.         until 06-31-1993               from 07-01-1993
  151.         Johannes Kiehl                 Johannes Kiehl
  152.         Postfach 2441                  Postfach 2441
  153.         D - W 5500 Trier               D - 54214 Trier
  154.  
  155.